class profile::node(
  String $node_download_url
) {
  $install_dir = $node_download_url.match(/https?:.*\/([a-zA-Z0-9\-\._]+)(\.tar\.gz|\.tar\.xz|\.zip)$/)
  class {'fragments::node::install':
    file_url => $node_download_url
    } ->
    class {'fragments::node::npmrc':}
    class {'fragments::node::profile':
      node_install_dir => "/opt/${install_dir[1]}"
    }
}
